package commons.utils.facades;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;

import commons.utils.facades.ActionFactoryFacade;

public class ActionFactoryFacadeRAP extends ActionFactoryFacade {

    @Override
    public IWorkbenchAction createAboutAction(IWorkbenchWindow window) {
        return new AboutAction(window);
    }

    private static final class AboutAction extends Action implements IWorkbenchAction {

        private IWorkbenchWindow _window;

        public AboutAction(IWorkbenchWindow window) {
            _window = window;
            setId(AboutAction.class.getName());
        }

        @Override
        public void run() {
            Shell parent = _window.getShell();
            MessageDialog.openInformation(parent, "Title", "Message");
        }

        @Override
        public void dispose() {
            // does nothing
        }
    }

}
